﻿<Window x:Class="_06.ResourceStyle.MergedResourceDict"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="ResourceDictDemo" Height="116" Width="446">
    <Window.Resources>
        <ResourceDictionary>
            <!--use merged resource dictionary to contain resource definition from different resources-->
            <ResourceDictionary.MergedDictionaries>
                <!--note: name conflict solution: in resource dictionary file there is one 'myBrush'
                and there is also one local-defined 'myBrush'
                which takes effect depends on the definition order
                Last-defined wins-->
                <ResourceDictionary Source="ResourceDict.xaml" />
                <ResourceDictionary>
                    <SolidColorBrush x:Key="myBrush" Color="SteelBlue"/>
                </ResourceDictionary>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Window.Resources>
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="*" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        <Button  Grid.Row="1" Grid.Column="0" Margin="6" 
                 BorderBrush="{StaticResource standaloneBrush}">OK</Button>
        <Button  Grid.Row="1" Grid.Column="1" Margin="6" 
                 BorderBrush="{StaticResource myBrush}">Cancel</Button>
        <DockPanel Grid.ColumnSpan="2">
            <Label DockPanel.Dock="Left" VerticalContentAlignment="Center" Margin="6">Name:</Label>
            <TextBox DockPanel.Dock="Right" 
                     VerticalContentAlignment="Center" 
                     HorizontalContentAlignment="Center" 
                     Margin="6"  >ABC</TextBox>
        </DockPanel>
    </Grid>
</Window>
